<?php
/**
 * Created by PhpStorm.
 * User: jichao
 * Date: 2015/12/9
 * Time: 15:09
 */
use yii\helpers\Url;
use yii\helpers\Html;
use yii\bootstrap\ActiveForm;

$this->title = '智慧农业平台';

$this->registerCssFile('@web/css/login.css');
$this->registerCssFile('@web/css/com-list.css');
$this->registerJsFile('@web/js/jquery.min.js');
?>

<div class="login-header">
    <div class="navbar-header">

        <a class="navbar-brand" href="#">
            <img alt="Brand" src="<?=Url::to('@web/images/logo2.png')?>">
        </a>

    </div>


    <div class="contact-left">
        <img src="<?=Url::to('@web/images/phone-logo.png')?>" />
        <div class="contact-info">
            <p>服务热线</p>
            <p>021-56385780</p>
            <p>021-56552073</p>
        </div>
    </div>
    <div class="vseperator"></div>
    <div class="contact-right">
        <img src="<?=Url::to('@web/images/qq-logo.png')?>" />
        <div class="contact-info">
            <p>QQ客服</p>
            <p>2560562349</p>
        </div>
    </div>
</div>
<div>


    <div class="center">
        <!--图片轮播-->

        <div class="img-wall">
            <div id="myCarousel" class="carousel slide" data-ride="carousel" data-interval="2000">

                <ol class="carousel-indicators">
                    <li data-target="#myCarousel" data-slide-to="0" class="active"></li>
                    <li data-target="#myCarousel" data-slide-to="1"></li>
                    <li data-target="#myCarousel" data-slide-to="2"></li>
                </ol>

                <div class="carousel-inner">
                    <div class="item active">
                        <img src="<?=Url::to('@web/images/display-imgs/2.jpg')?>" alt="First slide">
                        <div class="carousel-caption">标题 1</div>
                    </div>
                    <div class="item">
                        <img src="<?=Url::to('@web/images/display-imgs/1.jpg')?>" alt="Second slide">
                        <div class="carousel-caption">标题 2</div>
                    </div>
                    <div class="item">
                        <img src="<?=Url::to('@web/images/display-imgs/3.jpg')?>" alt="Third slide">
                        <div class="carousel-caption">标题 3</div>
                    </div>
                </div>

                <a class="carousel-control left" href="#myCarousel"
                   data-slide="prev">&lsaquo;</a>
                <a class="carousel-control right" href="#myCarousel"
                   data-slide="next">&rsaquo;</a>
            </div>
        </div>
        <!--图片轮播-->
        <div class="login-contain">
            <ul class="nav nav-tabs nav-justified">
                <li class="active" id="front-login"><a href="#">前台登入</a></li>
                <li id="back-login"><a href="#">后台登入</a></li>
            </ul>

            <div class="login-form">
                <div class="inner" id="front-login-div">
                    <div class="site-login">
                        <div class="row">
                            <div class="col-lg-5">
                                <?php $form = ActiveForm::begin(['id' => 'login-form']); ?>

                                <?= $form->field($model, 'username')->label('用户名')?>

                                <?= $form->field($model, 'password')->passwordInput()->label('密码') ?>

                                <?= $form->field($model, 'rememberMe')->checkbox()->label('记住我') ?>

                                <?= $form->field($model, 'type')->hiddenInput()->label(false)?>
                                <div style="color:#999;margin-left:50px;margin-bottom:15px;font-size:10px;">
                                    <!--如果你忘记了密码，请点击 --><?/*= Html::a('重置密码', ['site/request-password-reset']) */?>.
                                    还没有账号？ <?= Html::a('立即申请', ['site/signup']) ?>.
                                </div>

                                <div class="form-group">
                                    <?= Html::submitButton('登入', ['class' => 'btn btn-success', 'name' => 'login-button']) ?>
                                </div>

                                <?php ActiveForm::end(); ?>
                            </div>
                        </div>
                    </div>
                </div>

            </div>
        </div>
    </div>
<?php
$js = <<<JS
$(function(){
    $("#loginform-type").val(1);

    $('#back-login').click(function(){

        $("#loginform-type").val(2);
        $(this).addClass('active');
        $('#front-login').removeClass('active');

    })

    $('#front-login').click(function(){
        $("#loginform-type").val(1);
        $(this).addClass('active');
        $('#back-login').removeClass('active');

    })

})
JS;
$this->registerJs($js);
?>